<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
body {
-moz-box-shadow: 4px 4px 5px #888;
-webkit-box-shadow: 4px 4px 5px #888;
box-shadow: 4px 4px 5px #888;
}
-->
</style>
  <title>Iframe Title</title>
<meta charset=utf-8 />
</head>
<body onload=sendSize() style='padding:5px;border-radius:10px;border:2px solid lightblue;background-color:transparent;margin:0;font-family:arial'>
<div id=containerDiv style=background-color:linen>

<table style='width:300px;'>
<tr>
<td>
<table style='width:100%;background-color:gainsboro'>
<tr ><td id=drawRectTopTable style='width:90%;background-color:linen' align=center><span id=drawRectEditSpan>Draw Rectangles</span></td><td align=right> <button onClick=parent.closeDrawRect()  >X</button></td></tr>
</table>
</td>

</tr>

<tr>
<td align=center ><span id=drawRectStrokeBg >Stroke Color:</span>
<select  title="Stroke Color" onChange=parent.showDrawRectStrokeBg() id=drawRectStrokeSelect></select>
width:
  <select onChange=parent.drawRectStrokeWidthSelected() id=drawRectStrokeWidthSelect>
		<option >0.5</option>
		<option >1</option>
		<option selected>2</option>
		<option >3</option>
		<option >4</option>
		<option >5</option>
		<option >6</option>
		<option >7</option>
		<option >8</option>
		<option >9</option>
		<option >10</option>
		<option >15</option>
		<option >20</option>
		<option >25</option>
		<option >30</option>
		</select><br/>
Dash:<input type=checkbox id=drawRectStrokeDashCheck onClick=parent.drawRectStrokeDashChecked() />
  &nbsp;Shadow:<input id=drawRectShadowCheck onClick=parent.drawRectShadowChecked() type="checkbox" />

</td>
</tr>
<tr><td>Radius: <select title="Corner Radius"  id="rectCornerRadiusSelect" onChange=parent.rectCornerRadiusSelected()>
<option selected>4</option>
<option>8</option>
<option>12</option>
<option>16</option>
<option>20</option>
<option>24</option>
<option>28</option>
<option>32</option>
<option>36</option>
<option>40</option>
<option>44</option>
<option>48</option>

</select>

&nbsp; &nbsp; Rounded Corners:<input type=checkbox id=drawRectStrokeRoundCheck onClick=parent.drawRectStrokeRoundChecked() />
</td></tr>
<tr>
<td align=center ><span id=drawRectFillBg >Fill Color:</span>
<select  title="Fill Opacity" onChange=parent.showDrawRectFillBg() id=drawRectFillSelect></select>
Opacity:
  <select onChange=parent.drawRectOpacitySelected() id=drawRectOpacitySelect>
		<option >0.1</option>
		<option>0.2</option>
		<option >0.3</option>
		<option >0.4</option>
		<option>0.5</option>
		<option >0.6</option>
		<option >0.7</option>
		<option >0.8</option>
		<option >0.9</option>
		<option  selected >1.0</option>

		</select>

</td>
</tr>

<tr>
	<td valign=bottom align=center>Rotate
		&nbsp;&nbsp;<button  onClick=parent.rotateRectAdjust(-1) style='height:25px;width:25px;padding:0px'><img width=20 height=20 src="../Images/minusRound.png" /></button>
		<select title="rotate toggle value" id=rotateDrawRectAdjustSelect >
		<option>.5</option>
		<option>1</option>
		<option>2</option>
		<option selected>5</option>
		<option>10</option>
		</select>
		<button onClick=parent.rotateRectAdjust(1)   style='height:25px;width:25px;padding:0px'><img width=20 height=20 src="../Images/plusRound.png" /></button>
		&nbsp;<input id=adjustedRotateRectValue disabled type=text style='width:40px;' value=0 />&deg;
	</td>
</tr>


<tr align=center>
<td>
	<button id=drawRectCancelButton disabled title='cancel/remove this path' onClick=parent.cancelDrawRect()>cancel</button>
	<button style=visibility:hidden id=drawRectCopyButton title='Toggle for each copy of this rectangle' onClick=parent.copyDrawRect()>copy</button>
	<button id=drawRectTopButton style=background:white;font-size:120%;font-weight:bold;color:maroon;visibility:hidden  title='Move to top' onClick=parent.topDrawRect()>&#x21E7;</button>
	<button id=drawRectBotButton style=background:white;font-size:120%;font-weight:bold;color:maroon   title='Move to bottom' onClick=parent.botDrawRect()>&#x21E9;</button>
	<button style='background-color:red;visibility:hidden' id=drawRectDeleteButton  onClick=parent.removeCurrentDrawRect()>delete</button>
    <button id=drawRectFinishButton disabled onClick=parent.finishDrawRect()>finish</button>
</td>
</tr>

</table>
</div>


</body>
<script>

function writeRectColorSelection()
{
   var DrawColors=parent.clrArray
	for(var k=0;k<DrawColors.length;k++)
	{
		var name=DrawColors[k][0]
		var myColor=DrawColors[k][1]


		var option=document.createElement("OPTION")
		option.style.backgroundColor=myColor
		option.value=myColor
		option.title=name+" "+myColor
        		option.title=name+" "+myColor
   if(parent.hexString.indexOf(myColor)!=-1)
                option.style.color="white"

		option.text=k
        drawRectStrokeSelect.appendChild(option)


        		var option=document.createElement("OPTION")
		option.style.backgroundColor=myColor
		option.value=myColor
		option.title=name+" "+myColor
		option.text=k
           if(parent.hexString.indexOf(myColor)!=-1)
                option.style.color="white"


		option.text=k
        drawRectFillSelect.appendChild(option)



	}
	drawRectStrokeSelect.selectedIndex=353
	var clr=drawRectStrokeSelect.options[drawRectStrokeSelect.selectedIndex].value
	drawRectStrokeBg.style.backgroundColor=clr
}


function sendSize()
{
    writeRectColorSelection()

    var width=containerDiv.scrollWidth+15
    var height=containerDiv.scrollHeight+30

    parent.sizeFrame('addElemRect',width,height)

     if(parent.EditRect==true)
   		parent.setEditRect()
        else
          parent.startRectDraw()

}
</script>
</html>